using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using HengTong.Model.Db.SupplyChain.Purchase;
using HengTong.Model.Db.SupplyChain.Material;


namespace HengTong.ViewModel.SupplyChain.SysPurchaseRequestBillEntryVms
{
    public partial class SysPurchaseRequestBillEntryTemplateVm : BaseTemplateVM
    {
        [Display(Name = "采购申请单")]
        public ExcelPropety BillExcel = ExcelPropety.CreateProperty<SysPurchaseRequestBillEntry>(x => x.BillId);
        [Display(Name = "物料")]
        public ExcelPropety MaterialExcel = ExcelPropety.CreateProperty<SysPurchaseRequestBillEntry>(x => x.MaterialId);
        [Display(Name = "物料规格")]
        public ExcelPropety MaterialSkuExcel = ExcelPropety.CreateProperty<SysPurchaseRequestBillEntry>(x => x.MaterialSkuId);
        [Display(Name = "是否备用物资")]
        public ExcelPropety IsBackupMaterialExcel = ExcelPropety.CreateProperty<SysPurchaseRequestBillEntry>(x => x.IsBackupMaterial);
        [Display(Name = "申请数量")]
        public ExcelPropety RequestQuantityExcel = ExcelPropety.CreateProperty<SysPurchaseRequestBillEntry>(x => x.RequestQuantity);
        [Display(Name = "单位价格")]
        public ExcelPropety UnitPriceExcel = ExcelPropety.CreateProperty<SysPurchaseRequestBillEntry>(x => x.UnitPrice);
        [Display(Name = "总金额")]
        public ExcelPropety TotalAmountExcel = ExcelPropety.CreateProperty<SysPurchaseRequestBillEntry>(x => x.TotalAmount);
        [Display(Name = "预算金额")]
        public ExcelPropety BudgetAmountExcel = ExcelPropety.CreateProperty<SysPurchaseRequestBillEntry>(x => x.BudgetAmount);
        [Display(Name = "技术要求")]
        public ExcelPropety TechnicalRequirementExcel = ExcelPropety.CreateProperty<SysPurchaseRequestBillEntry>(x => x.TechnicalRequirement);
        [Display(Name = "要求到货日期")]
        public ExcelPropety RequiredArrivalDateExcel = ExcelPropety.CreateProperty<SysPurchaseRequestBillEntry>(x => x.RequiredArrivalDate);
        [Display(Name = "采购进度")]
        public ExcelPropety PurchaseProgressExcel = ExcelPropety.CreateProperty<SysPurchaseRequestBillEntry>(x => x.PurchaseProgress);

	    protected override void InitVM()
        {
            BillExcel.DataType = ColumnDataType.ComboBox;
            BillExcel.ListItems = DC.Set<SysPurchaseRequestBill>().GetSelectListItems(Wtm, y => y.BillCode);
            MaterialExcel.DataType = ColumnDataType.ComboBox;
            MaterialExcel.ListItems = DC.Set<SysMaterial>().GetSelectListItems(Wtm, y => y.Name);
            MaterialSkuExcel.DataType = ColumnDataType.ComboBox;
            MaterialSkuExcel.ListItems = DC.Set<SysMaterialSku>().GetSelectListItems(Wtm, y => y.Name);
        }

    }

    public class SysPurchaseRequestBillEntryImportVm : BaseImportVM<SysPurchaseRequestBillEntryTemplateVm, SysPurchaseRequestBillEntry>
    {

    }

}
